<?php

namespace App\Providers;

use App\Models\Examination;
use App\Models\Question;
use App\Models\Role;
use App\Models\Setting;
use App\Models\Category;
use App\Models\Permission;
use App\Models\TestList;
use App\Policies\Admin\ExaminationPolicy;
use App\Policies\Admin\QuestionPolicy;
use App\Policies\Admin\RolePolicy;
use App\Policies\Admin\SettingPolicy;
use App\Policies\Admin\CategoryPolicy;
use App\Policies\Admin\PermissionPolicy;
use App\Policies\Admin\TestListPolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
    /**
     * The policy mappings for the application.
     *
     * @var array
     */
    protected $policies = [
        // 策略映射
        Category::class => CategoryPolicy::class,
        Permission::class => PermissionPolicy::class,
        Role::class => RolePolicy::class,
        Setting::class => SettingPolicy::class,
        Examination::class => ExaminationPolicy::class,
        Question::class => QuestionPolicy::class,
        TestList::class => TestListPolicy::class

    ];

    /**
     * Register any authentication / authorization services.
     *
     * @return void
     */
    public function boot()
    {
        $this->registerPolicies();
    }
}
